<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .con{
            width: 500px;
            border: 2px solid red;
            margin: 0 auto;
            overflow: hidden;
        }
        </style>
</head>
<body>
    <div class="con">
       <div class="item"> 
          <img src="images/animal1.png"/>
       </div>
       <div class="item"> 
        <img src="images/animal2.png"/>
       </div>
       <div class="item"> 
        <img src="images/animal3.png"/>
       </div>
    </div>
</body>
<script> /*  document.getElementsByTagName(标签名字) 是用来获取页面中特定标签名的网页元素的DOM节点对象的数组 */
    var con = document.getElementsByTagName("con");
    var itemList = con.getElementsByTagName("div");

    for(var i =0;i<itemList.length;i++){
        itemListp[i].onmouseover =function(){
            this.style.backgroundColor ="blue";
        }
    }
 //   console.log(itemList);
    </script>
</html>